package com.clqteam.controller;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import com.clqteam.service.InitService;
import com.clqteam.serviceimpl.InitServiceImpl;

public class InitController extends HttpServlet{
	
	InitService initSer = new InitServiceImpl();
	
	@Override
	public void init() throws ServletException {

		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		Date nowdate = new Date();
		Date bef = new Date(nowdate.getTime()-63158400000l);		
		String date = sdf.format(bef);
		
		initSer.deleteDailyByDate(date);
		initSer.deleteOrderByDate(date);
		
	}

}
